import { useState, useEffect } from "react";
import {
  loadDepartmentsAPI,
  loadDoctorsAPI,
  loadTagsAPI,
  loadTitlesAPI,
} from "../services/doctors";
import { loadUsersAPI } from "../services/userInfo";
import { dalImg } from "../utils/tools";

/**
 * 自定一个hooks
 * @returns
 */
export function useUserData(): {
  users: App.IUser;
} {
  const [users, setUsers] = useState({});
  // const [categories, setCategories] = useState([]);
  // const [departments, setDepartments] = useState([]);
  // const [titles, setTitles] = useState([]);
  // const [tags, setTags] = useState([]);
  useEffect(() => {
    loadUsersAPI().then((res) => {
      setUsers(res.data);
    });
  }, []);

  return { users };
}
